Uses unasync to automatically generate all synchronous client code
#72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
unasyncapproach successfully used by projects likeelasticsearch-py, This PR is the first step toward supporting asyncio clients. (related Support asyncio #2)To avoid maintaining two separate, parallel codebases (one for sync, one for async), this PR introduces the
unasyncbuild system. This approach allows us to write all client logic as asynchronous code (incentraldogma/_async/) and then automatically generate the synchronous version from that source.unasync. No actual client logic (ContentService,Dogmaand so on) has been migrated yet. That will be done in follow-up PRs.Modifications:
unasyncas a development dependency.utils/run-unasync.pyas the main script to run code generation.centraldogma/_async/directory, which will become the "source of truth" for all async/sync client code._async/code but does not also commit the corresponding auto-generated sync code. This ensures the source and generated code are always in sync.test.ymltoci.ymlscripts/release.pytoutils/run-release.pyfor consistency.Result:
BaseClientasync and sync codes are maintained using a single file.